/*
 * @Author: windys
 * @Description: 自动化注册
 * @Date: 2022-02-23 13:22:02
 */

import { defineAsyncComponent } from 'vue'

const components = import.meta.glob('./*.vue')
export default function install(app) {
    for (const [key, value] of Object.entries(components)) {
        // const name = key.split('/')[1]
        const name = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'));
        app.component(name, defineAsyncComponent(value))
    }
}